<div id="def_payemnt_info" class="hid_item cancel_payment_info"<{if !$arr_def_payment || !$is_def_payment_match}> style="display:none;"<{/if}>>
	<{include file="site/common/paymethod_def_info.html" app=b2c}>
</div>

<div style="height:auto; padding:5px 0;<{if $arr_def_payment && $is_def_payment_match}>display:none;<{/if}>" class="hid_item payment_info">
	<{include file="site/common/paymethod_detail.html" app=b2c}>
</div>
<div class="cart-pay-conf-div payment_info hid_item"<{if $arr_def_payment && $is_def_payment_match}> style="display:none;"<{/if}>><input type="button" class="cart-btn"  id="btn_purchase_info_payment" value="<{t}>确认支付方式<{/t}>" /><input type="hidden" class="cart-confirm-btn<{if !$arr_def_payment || !$is_def_payment_match}> unfold<{/if}>" vtype="need_confirmed" caution='<{t}>支付方式没有确认！<{/t}>' /></div>
<script>
(function(){
	
	$('btn_purchase_info_payment').addEvent('click', function(el){
		// validate the purchase_info_shippping div area elements
		if( !button_valiate.is_validate($(el.target)) ) return;
		
		var cur_code = $('payment-cur').getValue();
		var _extends_args = $E('#order-create input[name^=json_extend_args]') ? $E('#order-create input[name^=json_extend_args]').value : null;
		
		if ($E('input[name^=payment[pay_app_id]]'))
			new Request.HTML({
				url:Shop.url.purchase_payment,
				update:'def_payemnt_info',
				method:'post',
				data:$E('#payment').toQueryString() + '&member_id=' + $E('input[name^=purchase[member_id]]').value + '&cur_code=' + cur_code + '&extends_args=' + _extends_args,
				onComplete:function(res){
					var _pay_app_id = $E('.x-payMethod:checked') ? $E('.x-payMethod:checked').value :'';
					$E('input[name^=purchase[pay_app_id]]').set('value', _pay_app_id);
					
					button_valiate.removeCaution($(el.target));
					$('cancel_payment_info').fireEvent('click',$('cancel_payment_info'));
				}
			}).send();
	});
})();
</script>